/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TimeRecording.forms.entities;

import TimeRecording.tables.Employee;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

public class SelectableEmployee {

    private Employee employee;
    private boolean selected;

    // <editor-fold defaultstate="collapsed" desc="Property Change Support">
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);

    public void addPropertyChangeListener(PropertyChangeListener listener) {
	changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
	changeSupport.removePropertyChangeListener(listener);
    } // </editor-fold>

    public SelectableEmployee() {
        this.selected = false;
        this.employee = null;
    }

    public SelectableEmployee(Employee employee, boolean selected) {
        this.employee = employee;
        this.selected = selected;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        Employee oldEmployee = this.employee;
        this.employee = employee;
	changeSupport.firePropertyChange("employee", oldEmployee, employee);
    }

    public boolean getSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        boolean oldSelected = this.selected;
        this.selected = selected;
	changeSupport.firePropertyChange("selected", oldSelected, selected);
    }
}